CREATE PROCEDURE [dbo].[bd_proc_overTimeResult]
  @order_id AS numeric
AS
BEGIN
	--调用考勤重新计算

	DECLARE @users VARCHAR(MAX) = ''
	DECLARE @overTimeDate DATE

	SELECT
		@users = @users + CAST(u.user_serial AS VARCHAR(100)) + ','
	FROM (
			select DISTINCT user_serial from lr_jiaba where order_id = @order_id
	) u

	SET @users = SUBSTRING(@users,0, LEN(@users))
	SELECT @overTimeDate = ot_date from bd_over_time_order where order_id = @order_id
	EXEC bd_proc_timecard @overTimeDate,@users,5


END